<?php

declare(strict_types=1);

namespace App\Model\Setting;

use Hyperf\DbConnection\Model\Model;

/**
 *  自动消息回复
 */
class SettingAutoMsg extends Model
{
    protected $table = 'setting_auto_msg';

    const TYPE_FAST = 1;
    const TYPE_SYS = 2;
    const TYPE = [
        self::TYPE_FAST => '快捷回复',
        self::TYPE_SYS => '系统消息',
    ];

    /**
     * 获取列表
     */
    static function getList($type = self::TYPE_FAST, $gender = -1)
    {
        return self::where(['flag' => 1, 'content_type' => $type])->whereIn('gender', [-1, $gender])->pluck('content')->toArray();
    }
}
